<form id="iconaddfm" method="post" style="padding: 8px;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel" width="20%">名称：</td>
            <td width="80%"><input name="title" type="text" style="width:400px;" v-model="params.name"
                                   class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入标题.." required="true"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel">类名：</td>
            <td width="80%"><input name="title" type="text" style="width:400px;" v-model="params.class"
                                   class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入类名.." required="true"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel" >排序：</td>
            <td width="80%"><input name="sortorder" type="text" v-model="params.sortorder"
                                   class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox" value="500"
                                   placeholder="请输入排序.."></td>
        </tr>
    </table>
</form>

<script>
    var iconAddVm = new Vue({
        el: '#iconaddfm',
        data: {
            params: {
                name: '',
                class: '',
                sortorder: 500,
            }
        },
        methods: {
            submit: function () {
                $.post('/admin/icon/increase', iconAddVm.params, function (data) {
                    if (data.ret == 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $('#iconaddfm').form('clear');
                        $("#icondlg").dialog('close');
                        $("#icon").treegrid('reload');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            }
        }
    });
    $(function () {
        $('#iconaddsubmit').click(function (data) {
            iconAddVm.submit();
        });
    });
</script>
